package com.lmf.controller;

import com.lmf.service.IndexTwoService;
import com.lmf.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    IndexService indexService;
    @Autowired
    IndexTwoService indexTwoService;

    /**
     * 调用feign客户端提供的服务,自带负载均衡
     */
    @GetMapping("/index/{name}")
    public String index(@PathVariable(value = "name")String username){
        //调用feign客户端的hello接口
        return indexService.sayHello(username);
    }
    @GetMapping("/test/{name}")
    public String test(@PathVariable(value = "name")String username){
        return indexTwoService.testTurbe(username);
    }
}
